The spatial data used in this report was collected from the Oil Spill Incident Tracking database by the California Department of Fish and Game Office of Spill Prevention & Response, published on July 23, 2009.

oil_spills <- read_sf(here("ds394.shp"))
ca_counties <- read_sf(here("ca_counties","CA_Counties_TIGER2016.shp"))

ca_subset <- ca_counties %>% 
  select(NAME, ALAND) %>% 
  rename(county_name = NAME, land_area = ALAND)

#ca_subset %>% st_crs()
#oil_spills %>% st_crs()

oil_spills <- st_transform(oil_spills, 3857)

#oil_spills %>% st_crs()

Interactive Map of Inland Oil Spill Events in California

# Set the viewing mode to "interactive":
tmap_mode(mode = "view")

tm_shape(ca_subset) +
  tm_borders() +
  tm_shape(oil_spills) +
  tm_dots(col = "red1") +
  tmap_style("natural")

Figure 1. California oil spill events for the year 2008 are displayed by red points. Click on a point to see information about the individual spill event.

ca_oil <- ca_subset %>% 
  st_join(oil_spills)

oil_counts <- ca_oil %>% 
  count(county_name)

Choropleth Map of Inland Oil Spill Events by California County

ggplot(data = oil_counts) +
  geom_sf(aes(fill = n), color = "black", size = 0.1) +
  scale_fill_gradientn(colors = c("white","orange","red")) +
  theme_void() +
  labs(fill = "Number of oil spills")

Figure 2. California oil spill events for the year 2008 are summed by county, with the abundance of spills displayed by a gradient between zero spills in white to 500+ spills in red. The county with the highest number of oil spills in 2008 was Los Angeles County.